<template>

	<div>
		
		<input  type="radio" name="login" value="1" v-model="loginType"/>手机号登录
		<input  type="radio" name="login" value="2" v-model="loginType"/>邮箱登录
		
		
		<!-- key   避免组件的重复利用   -->
		<div v-if="loginType == 1 ">
			<input type="text" name="telephone" value="" placeholder="请输入手机号"    key="telephone" />
		</div>
		<div v-else-if="loginType == 2 ">
			<input type="text" name="email" value="" placeholder="请输入邮箱"  key="email" />
		</div>
		  
	
		
	</div>
	
	
</template>

<script>
	export default{
		name:'IfComponent',
		data(){
			return {
				loginType:'1',
			}
		},
		methods:{
			changeGender(){
				if(this.gender === '男'){
					this.gender ='女'
				}else{
					this.gender ='男'
				}
			}
		}
	}
	
	
</script>

<style scoped>
	
	
	
	
</style>